<template>
	<view class="wrapper">
		<view class="title">阿拉丁神灯</view>
		<view class="bg">
			<view class="content"></view>
		</view>
		<view class="button-wrap">
			<view class="btn confirm" @click="gotoPageFun('/pages/login/step2')">
				创建钱包
			</view>
			<view class="btn cancel" @click="gotoPageFun('/pages/login/restore')">
				恢复钱包
			</view>
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default{
		data(){
			return {}
		},
		onLoad(){
			let account_id = uni.getStorageSync('account_id');
			const register = uni.getStorageSync('register');
			if(account_id && register){
				uni.redirectTo({
				    url: '/pages/property/property'
				});
			}
		},
		methods:{
			gotoPageFun(path){
				if(getApp().globalData.clientid){
					uni.navigateTo({
					    url: path
					});
				} else {
					try{
						getApp().globalData.clientid = plus.push.getClientInfo().clientid
					} catch(e){
						this.$refs.uToast.show({
							title: '获取不到手机clientid',
							type: 'error',
						})
					}
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wrapper{
		width:100%;
		overflow: hidden;
		.title{
			font-size: 48rpx;
			font-family: PingFang SC;
			font-weight: 600;
			color: #FFFFFF;
			line-height: 66rpx;
			text-align: center;
			margin-top:90*2rpx;
		}
		.bg{
			width: 163*2rpx;
			height: 163*2rpx;
			margin:42*2rpx auto 0;
			background-image: url('/static/login/logo-bg.png');
			background-size: 100% 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			.content{
				width: 70*2rpx;
				height: 70*2rpx;
				background: url('/static/login/logo.png');
				background-size: 100% 100%;
			}
		}
		.button-wrap{
			padding:0 40rpx;
			position:fixed;
			bottom:124rpx;
			width: 100%;
			.btn{
				height:120rpx;
				line-height:120rpx;
				color:#fff;
				border-radius: 14rpx;
				text-align: center;
				font-size:32rpx;
				&.confirm{
					background-color: #FFB721;
				}
				&.cancel{
					margin-top:20rpx;
				}
			}
		}
	}
</style>
